package com.class05;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.io.IOException;

@WebServlet("/servletC")
public class ServletC extends HttpServlet {

    @Override
    public void service(ServletRequest req, ServletResponse res)
            throws ServletException, IOException {
//        1、测试转发跳转静态资源
//        req.getRequestDispatcher("hello.html").forward(req,res);
//        2、请求转发WEB-INF目录下的资源 需要加上"WEB-INF/"这级路径
//        req.getRequestDispatcher("WEB-INF/helloA.html").forward(req,res);
//        3、测试转发到外部资源如：http://www.baidu.com //不能转发到外部资源
        req.getRequestDispatcher("https://www.baidu.com").forward(req,res);



    }
}